//**********角色***********/;
import request from '@/utils/request.js';

/**
 * 保存
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 
 *  menuIdList:'', // 	类型:array 非必填
 *  role:'', // 	类型:undefined 非必填
 * @returns
 * ********
 */
export function postHmrole(data={}, config={}){
  return request({
    method: 'post',
    data,
    url: `/api/hmrole`,
    ...config,
  }) 
}

/**
 * 修改
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 
 *  menuIdList:'', // 	类型:array 非必填
 *  role:'', // 	类型:undefined 非必填
 * @returns
 * ********
 */
export function putHmrole(data={}, config={}){
  return request({
    method: 'put',
    data,
    url: `/api/hmrole`,
    ...config,
  }) 
}

/**
 * 删除
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 // 类型 array
 * []integer
 * @returns
 * ********
 */
export function deleteHmrole(data=[], config={}){
  return request({
    method: 'delete',
    data,
    url: `/api/hmrole`,
    ...config,
  }) 
}

/**
 * 根据Id获取具体的角色信息
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * id:'', //id 必填
 * @returns
 * ********
 */
export function getHmroleInfo(params={}, config={}){
  return request({
    method: 'get',
    params,
    url: `/api/hmrole/info`,
    ...config,
  }) 
}

/**
 * 获取所有的角色
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * pageNo:'', //页码 非必填
 * pageSize:'', //每页数据条数 非必填
 * name:'', //name 非必填
 * status:'', //status 非必填
 * @returns
 * ********
 */
export function getHmrolePageList(params={}, config={}){
  return request({
    method: 'get',
    params,
    url: `/api/hmrole/page/list`,
    ...config,
  }) 
}

/**
 * 根据应用权限列表
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * appId:'', //appId 必填
 * @returns
 * ********
 */
export function getHmroleRoleperms(params={}, config={}){
  return request({
    method: 'get',
    params,
    url: `/api/hmrole/role-perms`,
    ...config,
  }) 
}

/**
 * 根据角色id获取对应的权限列表
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * id:'', //id 非必填
 * @returns
 * ********
 */
export function getHmroleRolepermsid(params={}, config={}){
  return request({
    method: 'get',
    params,
    url: `/api/hmrole/role-perms-id`,
    ...config,
  }) 
}

/**
 * 禁用/启用角色
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 
 *  appId:'', //$column.comments 	类型:integer 非必填
 *  comment:'', //描述 	类型:string 非必填
 *  createBy:'', //$column.comments 	类型:string 非必填
 *  createDate:'', //$column.comments 	类型:string 非必填
 *  deleted:'', //0:未删除 1：删除 	类型:integer 非必填
 *  id:'', // 	类型:integer 非必填
 *  modifyBy:'', //$column.comments 	类型:string 非必填
 *  modifyDate:'', //$column.comments 	类型:string 非必填
 *  name:'', //角色名称 	类型:string 非必填
 *  status:'', // 1：在用  2：禁用 	类型:integer 非必填
 * @returns
 * ********
 */
export function putHmroleStatus(data={}, config={}){
  return request({
    method: 'put',
    data,
    url: `/api/hmrole/status`,
    ...config,
  }) 
}

/**
 * 表单字段验证
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * id:'', //id 必填
 * key:'', //key 必填
 * value:'', //value 必填
 * @returns
 * ********
 */
export function getHmroleValidatefield(params={}, config={}){
  return request({
    method: 'get',
    params,
    url: `/api/hmrole/validate-field`,
    ...config,
  }) 
}